import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    showCupertinoDialog(
        context: context,
        builder: (BuildContext context) {
          return CupertinoAlertDialog(
            content: Text('欢迎使用苹果风格警示窗'),
            actions: <Widget>[
              RaisedButton(
                child: Text('确认'),
                onPressed: () {},
              ),
              RaisedButton(
                child: Text('取消'),
                onPressed: () {},
              ),
            ],
          );
        });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        centerTitle: true,
        title: Text('Materilal App Bar'),
      ),
      body: Center(child: Text('弹出警示窗')),
    );
  }
}
